package com.ruoyi.transaction.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.transaction.mapper.YZMProductCommentsMapper;
import com.ruoyi.common.entity.TransactionEntity.YZMProductComments;
import com.ruoyi.transaction.service.IYZMProductCommentsService;

/**
 * 商品评价Service业务层处理
 * 
 * @author yzm
 * @date 2025-08-07
 */
@Service
public class YZMProductCommentsServiceImpl implements IYZMProductCommentsService 
{
    @Autowired
    private YZMProductCommentsMapper yZMProductCommentsMapper;

    /**
     * 查询商品评价
     * 
     * @param id 商品评价主键
     * @return 商品评价
     */
    @Override
    public YZMProductComments selectYZMProductCommentsById(Integer id)
    {
        return yZMProductCommentsMapper.selectYZMProductCommentsById(id);
    }

    /**
     * 查询商品评价列表
     * 
     * @param yZMProductComments 商品评价
     * @return 商品评价
     */
    @Override
    public List<YZMProductComments> selectYZMProductCommentsList(YZMProductComments yZMProductComments)
    {
        return yZMProductCommentsMapper.selectYZMProductCommentsList(yZMProductComments);
    }

    /**
     * 新增商品评价
     * 
     * @param yZMProductComments 商品评价
     * @return 结果
     */
    @Override
    public int insertYZMProductComments(YZMProductComments yZMProductComments)
    {
        yZMProductComments.setCreateTime(DateUtils.getNowDate());
        return yZMProductCommentsMapper.insertYZMProductComments(yZMProductComments);
    }

    /**
     * 修改商品评价
     * 
     * @param yZMProductComments 商品评价
     * @return 结果
     */
    @Override
    public int updateYZMProductComments(YZMProductComments yZMProductComments)
    {
        yZMProductComments.setUpdateTime(DateUtils.getNowDate());
        return yZMProductCommentsMapper.updateYZMProductComments(yZMProductComments);
    }

    /**
     * 批量删除商品评价
     * 
     * @param ids 需要删除的商品评价主键
     * @return 结果
     */
    @Override
    public int deleteYZMProductCommentsByIds(Integer[] ids)
    {
        return yZMProductCommentsMapper.deleteYZMProductCommentsByIds(ids);
    }

    /**
     * 删除商品评价信息
     * 
     * @param id 商品评价主键
     * @return 结果
     */
    @Override
    public int deleteYZMProductCommentsById(Integer id)
    {
        return yZMProductCommentsMapper.deleteYZMProductCommentsById(id);
    }
}
